clc
clear all
sig = testSignal(0,10,1023);
tic
fsig = fft(sig);
toc
tic
fsig2 = myFFT(sig);
toc
subplot(3,1,1)
plot(sig)
subplot(3,1,2)
plot(abs(fftshift(fsig)))
subplot(3,1,3)
plot(abs(fftshift(fsig2)))

N = 128;
filterLen = 8;
%matrixdarstellung
[Fm W W2] = creatingFilterMatrix(N,filterLen);

%filterdarstellung
Fnh = createFn(N2);
fnd = blkdiag(Fnh,Fnh);
A = diag(W2(1:N2,1));
C = diag(W2((N2+1):end,1));
B = diag(W2(1:N2,end));
D = diag(W2((N2+1):end,end));

X = [A B;C D];

%***********************


x = [1:128]';
fx = fft(x);
fx2 = Fm*x;


subplot(2,1,1)
plot(fx2)
subplot(2,1,2)
plot(fx)
norm(fx-fx2)

[Fm W W2] = creatingFilterMatrix(128,1);
subplot(2,2,1)
imagesc(abs(Fm*W'));


[Fm W W2] = creatingFilterMatrix(128,2);
subplot(2,2,2)
imagesc(abs(Fm*W'));

[Fm W W2] = creatingFilterMatrix(128,4);
subplot(2,2,3)
imagesc(imag(Fm*W'));

[Fm W W2] = creatingFilterMatrix(128,16);
subplot(2,2,4)
imagesc(real(Fm*W'));



